﻿module Features



open System.IO
open System.Runtime.Serialization
open Sources
open Tokens
open Keywords
open Scenarios



// TODO test for serial-a-tivity
// TODO internal setters? needbacking variables
[<DataContract>]
type public FeatureHeader(keyword, description) = 

   [<DataMember>]
   member val Keyword : Token = keyword with get, set

   [<DataMember>]
   member val Description : Token = description with get, set



//type Feature = {
//   Header : FeatureHeader
//   Scenarios : Scenario[]
//   }



let ReadFeatureHeader(reader : SourceReader) =
   let keyword = ReadKeyword(reader , Keyword.Feature)

   if (keyword.IsNone) then
      None
   else
      let description = ReadDescription(reader)
      
      if (description.IsNone) then
         None
      else
         Some(FeatureHeader(keyword.Value, description.Value ))

